<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../bootstrap-5.1.3-dist/css/bootstrap.css">
    <script src="../bootstrap-5.1.3-dist/js/bootstrap.js"></script>
</head>

<body class="container">
    <h2>响应式地显示或隐藏</h2>
    <div class="d-md-none bg-primary text-white">在xs、sm设备上显示（蓝色背景）</div>
    <div class="d-none d-md-block bg-danger text-white">在md、lg、xl设备上显示（浅红色背景）</div>
</body>

</html>